From: Giovanni Campagna Date: Sat, 17 Dec 2011 22:54:45 +0000 (+0100) Subject: NetworkMenu: actually add new access point to the network list X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7235 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=77afd6782fcf5b646e9fc30dc9c1882958e9c55c;p=gnome-shell.git NetworkMenu: actually add new access point to the network list Previously the code in _accessPointAdded was iterating over the the network list to find a good place, and at that time, added both the network to the list and the item to the menu. When I refactored to call queueCreateSection, I forgot to add code to insert the network in the list. Add it now, using the new Util.insertSorted function. https://bugzilla.gnome.org/show_bug.cgi?id=666429 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 863792d0d..fcf0835c1 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1234,7 +1234,6 @@ const NMDeviceWireless = new Lang.Class({ accessPoints: [ accessPoint ] }; apObj.ssidText = ssidToLabel(apObj.ssid); - needsupdate = true; } // check if this enables new connections for this group @@ -1249,7 +1248,11 @@ const NMDeviceWireless = new Lang.Class({ } } - if (needsupdate) { + if (pos == -1 || needsupdate) { + if (pos != -1) + this._networks.splice(pos, 1); + pos = Util.insertSorted(this._networks, apObj, this._networkSortFunction); + this._clearSection(); this._queueCreateSection(); }